package com.ruoyi.mayi.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.mayi.mapper.ApiLogMapper;
import com.ruoyi.mayi.domain.ApiLog;
import com.ruoyi.mayi.service.IApiLogService;

import javax.annotation.Resource;

/**
 * Api接口日志Service业务层处理
 * 
 * @author mayi
 * @date 2022-02-12
 */
@Service
public class ApiLogServiceImpl implements IApiLogService 
{
    @Resource
    private ApiLogMapper apiLogMapper;

    /**
     * 查询Api接口日志
     * 
     * @param id Api接口日志主键
     * @return Api接口日志
     */
    @Override
    public ApiLog selectApiLogById(Long id)
    {
        return apiLogMapper.selectApiLogById(id);
    }

    /**
     * 查询Api接口日志列表
     * 
     * @param apiLog Api接口日志
     * @return Api接口日志
     */
    @Override
    public List<ApiLog> selectApiLogList(ApiLog apiLog)
    {
        return apiLogMapper.selectApiLogList(apiLog);
    }

    /**
     * 新增Api接口日志
     * 
     * @param apiLog Api接口日志
     * @return 结果
     */
    @Override
    public int insertApiLog(ApiLog apiLog)
    {
        apiLog.setCreateTime(DateUtils.getNowDate());
        return apiLogMapper.insertApiLog(apiLog);
    }

    /**
     * 修改Api接口日志
     * 
     * @param apiLog Api接口日志
     * @return 结果
     */
    @Override
    public int updateApiLog(ApiLog apiLog)
    {
        return apiLogMapper.updateApiLog(apiLog);
    }

    /**
     * 批量删除Api接口日志
     * 
     * @param ids 需要删除的Api接口日志主键
     * @return 结果
     */
    @Override
    public int deleteApiLogByIds(Long[] ids)
    {
        return apiLogMapper.deleteApiLogByIds(ids);
    }

    /**
     * 删除Api接口日志信息
     * 
     * @param id Api接口日志主键
     * @return 结果
     */
    @Override
    public int deleteApiLogById(Long id)
    {
        return apiLogMapper.deleteApiLogById(id);
    }
}
